package com.helu.lubike.fragment;

import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.helu.lubike.R;
import com.helu.lubike.activity.AboutActivity;
import com.helu.lubike.utils.Utils;
import com.helu.lubike.databinding.FragMenuBinding;

/**
 * @author helu  17-2-7 下午1:16
 * @description
 */

public class MenuFragment extends Fragment implements View.OnClickListener {

    private FragMenuBinding inflate;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        inflate = DataBindingUtil.inflate(inflater, R.layout.frag_menu, null, false);

        initListener();
        return inflate.getRoot();
    }


    private void initListener() {
        inflate.xcjl.setOnClickListener(this);
        inflate.qb.setOnClickListener(this);
        inflate.xinyong.setOnClickListener(this);
        inflate.hysq.setOnClickListener(this);
        inflate.guanyu.setOnClickListener(this);
        inflate.sz.setOnClickListener(this);
    }


    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.xcjl:
                Utils.showToast(getActivity(), "行程记录");
                break;
            case R.id.qb:
                Utils.showToast(getActivity(), "钱包");
                break;
            case R.id.xinyong:
                Utils.showToast(getActivity(), "信用");
                break;
            case R.id.hysq:
                Utils.showToast(getActivity(), "好友邀请");
                break;
            case R.id.guanyu:       //关于
                startActivity(new Intent(getContext(), AboutActivity.class));
                break;
            case R.id.sz:
                Utils.showToast(getActivity(), "设置");
                break;
        }
    }
}
